home *** CD-ROM | disk | FTP | other *** search
- property DoitReadapterTailleImage, tailleorigin, X, Y
-
- on beginSprite
- X = the width of sprite the currentSpriteNum
- Y = the height of sprite the currentSpriteNum
- end
-
- on prepareFrame
- resize1(the currentSpriteNum, the memberNum of sprite the currentSpriteNum, the castLibNum of sprite the currentSpriteNum)
- sprite(the currentSpriteNum).visible = 1
- end
-
- on resize1 NumDuSprite, NumDuMember, NumCastlib
- member(NumDuMember, NumCastlib).centerRegPoint = 1
- taille_d_origine(X, Y, NumDuMember, NumCastlib)
- if (DoitReadapterTailleImage = 1) and ((getAt(tailleorigin, 1) > X) or (getAt(tailleorigin, 2) > Y)) then
- compteclic = 0
- set the floatPrecision to 2
- if (float(X) / float(getAt(tailleorigin, 1))) < (float(Y) / float(getAt(tailleorigin, 2))) then
- prctplusreduit = float(X) / float(getAt(tailleorigin, 1)) * 100
- set the height of sprite NumDuSprite to float(getAt(tailleorigin, 2)) * float(prctplusreduit) / 100
- set the width of sprite NumDuSprite to float(getAt(tailleorigin, 1)) * float(prctplusreduit) / 100
- else
- prctplusreduit = float(Y) / float(getAt(tailleorigin, 2)) * 100
- set the width of sprite NumDuSprite to float(getAt(tailleorigin, 1)) * float(prctplusreduit) / 100
- set the height of sprite NumDuSprite to float(getAt(tailleorigin, 2)) * float(prctplusreduit) / 100
- end if
- else
- if (DoitReadapterTailleImage = 1) and ((the width of sprite NumDuSprite > X) or (the height of sprite NumDuSprite > Y)) then
- compteclic = 0
- set the width of sprite NumDuSprite to getAt(tailleorigin, 1)
- set the height of sprite NumDuSprite to getAt(tailleorigin, 2)
- else
- set the width of sprite NumDuSprite to getAt(tailleorigin, 1)
- set the height of sprite NumDuSprite to getAt(tailleorigin, 2)
- end if
- end if
- updateStage()
- end
-
- on taille_d_origine X, Y, NumDuMember, NumCastlib
- global tailleorigin, DoitReadapterTailleImage
- tailleorigin = list(member(NumDuMember, NumCastlib).width, member(NumDuMember, NumCastlib).height)
- if (getAt(tailleorigin, 1) > X) or (getAt(tailleorigin, 2) > Y) then
- DoitReadapterTailleImage = 1
- else
- DoitReadapterTailleImage = 0
- end if
- end
-